﻿using Preactor.ObjectModel.Attributes;
using Preactor.ObjectModel.Entities;
using Preactor.ObjectModel.Interfaces;

namespace Preactor.ObjectModel.BaseTypes
{
    public class SecondaryConstraint : PreactorRecord, ISecondaryConstraint
    {
        [PreactorField("SEQ GRAPH", FieldDeclarationType.FieldClassification)]
        public string Name { get { return (string)GetValue("Name"); } set { SetValue("Name", value); } }

        [PreactorField("SECONDARY CONSTRAINT", FieldDeclarationType.FieldClassification)]
        public bool IsConstraint { get { return (bool)GetValue("IsConstraint"); } set { SetValue("IsConstraint", value); } }


        public SecondaryConstraint(PrimaryKey id, PreactorObjectModel preactorObjectModel) : base(id, preactorObjectModel)
        {
        }

        public override string ToString()
        {
            return string.Format("Type: SecondaryConstraint, Format Name: {0}, PK: {1}", FormatName, Id.Value);
        }
    }
}
